= form_for [:admin, @label], html: { class: 'form-horizontal label-form js-requires-input' } do |f|
  = form_errors(@label)

  .form-group
    = f.label :title, "标题", class: 'control-label'
    .col-sm-10
      = f.text_field :title, class: "form-control", required: true
  .form-group
    = f.label :description, "描述", class: 'control-label'
    .col-sm-10
      = f.text_field :description, class: "form-control js-quick-submit"
  .form-group
    = f.label :color, "背景颜色", class: 'control-label'
    .col-sm-10
      .input-group
        .input-group-addon.label-color-preview &nbsp;
        = f.color_field :color, class: "form-control"
      .help-block
        选择任意颜色。
        %br
        或者在下方选择推荐的颜色

      .suggest-colors
        - suggested_colors.each do |color|
          = link_to '#', style: "background-color: #{color}", data: { color: color } do
            &nbsp;

  .form-actions
    = f.submit '保存', class: 'btn btn-save js-save-button'
    = link_to "取消", admin_labels_path, class: 'btn btn-cancel'

:javascript
  new Labels();
